package github.sf.fw.tools.db.impl.oracle;

import com.alibaba.druid.DbType;
import com.alibaba.druid.sql.PagerUtils;
import github.sf.fw.tools.db.DSProperty;
import github.sf.fw.tools.db.impl.RdbmsTableDataReader;
import github.sf.fw.tools.db.impl.mysql.MysqlConstants;
import github.sf.fw.utils.StrUtil;


public class OracleTableDataReader extends RdbmsTableDataReader {


    public OracleTableDataReader(DSProperty dsProperty) {
        super(dsProperty);
    }

    public String wrapLimit(String sql, int start, int end) {
        return StrUtil.format(MysqlConstants.QUERY_TABLE_LIMIT, sql, start, end);
    }

    @Override
    protected String getLimitSentence(String sql, int offset, int count) {
        return PagerUtils.limit(sql, DbType.oracle, offset, count);
    }
}
